//
//  GSheetXmlModel.m
//  helpinrain
//
//  Created by Gang.Wang on 12-7-26.
//  Copyright (c) 2012年 Zhuhai Yuike Technology Co., Ltd. All rights reserved.
//

#import "GSheetXmlModel.h"
#import "GMagazine.h"

@implementation GSheetXmlModel

@synthesize magazine = magazine_;

- (void) dealloc
{
    YRelease(magazine_)
    [super dealloc];
}


- (void) init_
{
    self.name = [self.xmlTree attributeValueOfName:@"name" atPath:@"book/sheet"];
    self.description = [self.xmlTree attributeValueOfName:@"description" atPath:@"book/sheet"];
    
    GMagazine * temp_magazine = [[GMagazine alloc] initWithXmlTree:[self.xmlTree parsedTreeAtPath:@"book/sheet/magazine"]];
    self.magazine = temp_magazine;
    YRelease(temp_magazine)
    
}

- (id) initWithXmlLocalPath:(NSURL *)xmlLocalPath
{
    self = [super initWithXmlLocalPath:xmlLocalPath];
    if (self) {
        [self init_];
    }
    return self;
}

- (id) initWithXmlTree:(XMLParsedTree *)tree
{
    self = [super initWithXmlTree:tree];
    if (self) {
        [self init_];
    }
    return self;
}
@end
